#include "SinAndCos.h"
#include "math.h"
calculTrajectorySin::calculTrajectorySin() : time(this,0), amplitude(this,1), frequency(this,1), offset(this,0), positive(true){}

void calculTrajectorySin::doUpdate()
{
	float value=amplitude*sin((time)*frequency+offset);
	if(!positive)
		value*=-1;

	setValue(value);
}

calculTrajectoryCos::calculTrajectoryCos() : time(this,0), amplitude(this,1), frequency(this,1), offset(this,0), positive(true)
{}
void calculTrajectoryCos::doUpdate()
{
	float value=amplitude*sin((time)*frequency+offset);
	if(!positive)
		value*=-1;

	setValue(value);
}